package com.ashley.day_0607;
//数组的反转
public class ArrayTest4 {

	public static void main(String[] args) {
		String[] arr = new String[] { "aa", "bb", "cc", "dd", "ee" };
		for (int i = 0; i < arr.length / 2; i++) {//法一：
			String temp = arr[i];
			arr[i] = arr[arr.length - 1 - i];
			arr[arr.length - 1 - i] = temp;
		}
		/*for(int i = 0,j = arr.length - 1;i < j;i++,j--){//法二：
		String temp = arr[i];
			arr[i] = arr[j];
			arr[j] = temp;
		}
 
		  */
		for (int i = 0; i < arr.length; i++) {
			System.out.print(arr[i] + "\t");
		}
		System.out.println();
	}
}
